RNA structure is important in understanding many biological processes, including translation regulation in messenger RNA, replication of single stranded RNA viruses and the function of structural RNAs and RNA/protein complexes. Modeling RNA secondary structure is sufficient for understanding RNA function in some situations. When greater detail is required, a secondary structure is a significant step towards a three dimensional model. The folding of single stranded DNA is important not only in living systems, but also in a growing number of applications in biotechnology. The long term goal of this work is to develop the best possible algorithms for predicting nucleic acid secondary structure by free energy minimization using the most up-to-date thermodynamic parameters available. This project will extend the nucleic acid folding model to deal with 2 molecules at the same time. Concentrations of both species will be crucial in these computations, and the possibility of homodimer formation will have to be considered. A practical approach will be taken to predicting foldings containing a small number of pseudoknots. Non-canonical base pairs will continue to be treated in the context of special rules for small, symmetric interior loops, and the search for more realistic rules for multi-branch loops will continue. Corrections for monovalent and divalent ion concentrations will be added to the DNA folding algorithm. Statistical rules for RNA folding will be derived from large databases of secondary structures, including small subunit ribosomal RNA (SSU rRNA), large subunit (LSU) rRNA, 5S rRNA and group I introns. Base pair stacking frequencies and the frequencies of other small structural motifs can be converted into "pseudo energy rules" by computing the logarithm of the ratio of the observed frequencies over the expected frequencies derived from a random model. These numbers will be compared to the thermodynamic parameters and should yield valuable insights. These database derived parameters could be used alone in folding, or together with existing, thermodynamically derived rules. Suboptimal foldings are computed to mitigate the uncertainties in the modeling and to reflect the biological reality that alternative foldings can exist. This suboptimal approach can be melded with a partition function calculation that allows the computation of probabilities of base pair formation. Partition functions will be computed for the latest folding rules, for the bimolecular folding program and, in a limited way, for folding with pseudoknots. Partition function computations will be extended to allow folding constraints and to compute probabilities of foldings similar to a given one.